import { createStore, combineReducers } from "redux"
import { user } from "./reducers/user"
import { persistStore, persistReducer } from "redux-persist";
import autoMergeLevel2 from 'redux-persist/lib/stateReconciler/autoMergeLevel2';
import storage from "redux-persist/lib/storage";

const reducer = combineReducers({ user })
const persistConfig = {
    key: "user",
    storage: storage,
    stateReconciler: autoMergeLevel2 // 查看 'Merge Process' 部分的具体情况
};
const myPersistReducer = persistReducer(persistConfig, reducer);

const store = createStore(myPersistReducer);


export const persistor = persistStore(store);

export default store
